package com.ruoyi.tester.executor.expression;

import com.ruoyi.tester.executor.ExpressionContext;
import org.springframework.stereotype.Component;

/**
 * @author SongJun
 * @description TODO:
 * @date 2022/4/21 16:33
 */
@Component
public class ExpEquals implements ExpressionAnalysis {
    @Override
    public String getExpressionName() {
        return "equals";
    }

    @Override
    public String getDescription() {
        return "equals(x) 返回当前文本类型的上下文是否与文本类型x完全相同;";
    }

    @Override
    public Object analysis(ExpressionContext context, String... param) {
        String strBody = context.getContext().toString();
        return strBody.equals(param[0]);
    }
}
